<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
cfc('core')->checklogin();
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){
	$return=array();
	$item=pdo_get('core_members',array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']),array('avatar','nickname'));
	$register=uni_setting('register');
	$register['user_xieyi']=$register['user_xieyi']?:'本平台尊重和保护用户的隐私。本隐私政策将告诉您我们如何收集和使用有关您的信息，以及我们如何保护这些信息的安全。您成为本平台用户前务必仔细阅读本隐私条款并同意所有隐私条款。本隐私政策条款在您注册成为本平台用户后立即生效，并对您及本平台产生约束力。';
	$item['user_xieyi']=$register['user_xieyi'];
	$item['xieyi_title']=$register['xieyi_title'];
	$return['item']=$item;
	exi($return);
}
if($_RQ['op']=='getwechat'){
	exi('获取成功！');
}
if($_RQ['op']=='post'){
	$post=get_postdata();
	if($post['check']!=1 && $post['needcheck']){
		exi('请先阅读协议！','error');
	}
	if(!$post['nickname']){
		exi('请先完善会员昵称！','error');
	}
	$data=array_fields(array('nickname','avatar'),$post);
	pdo_update('core_members',$data,array('id'=>$_SESSION['uid'],'uniacid'=>$_SESSION['uniacid']));
	$_SESSION['member']['nickname']=$post['nickname'];
	if($post['setmember']==1){
		exi('完善信息成功！');
	}else{
		exi('设置成功！','','goback');
	}
}